package com.zhilianbao.leyaogo.view.widgets;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

/**
 * ClassName: MyRelativeLayout <br>
 * Description: <br>
 * Author: Cyarie <br>
 * Created: 2016/11/1 09:38 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class MyRelativeLayout extends RelativeLayout {

    private boolean pass = true;//是否向下传递事件

    public MyRelativeLayout(Context context) {
        super(context);
    }

    public MyRelativeLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (pass) {
            return super.onInterceptTouchEvent(ev);
        } else {
            return true;
        }

    }


    public void setPass(boolean pass) {
        this.pass = pass;
    }
}
